package rolesystem.agentlogic.parameters;

public class ConfigurationParameters
{
	
	
	
	/*-------------------General-------------------*/
	
	/**
	 * The number of agents in the simulation - Carry Objects
	 */
	public static int NUMBER_OF_AGENTS_CARRY=8;
	
	/**
	 * The number of agents in the simulation - Space Exploration
	 */
	public static int NUMBER_OF_AGENTS_EXPL=12;
	
	/**
	 * The number of agents in the simulation - Carry Objects Coordinator
	 */
	public static int NUMBER_OF_AGENTS_CARRY_COOR=8;
	
	/**
	 * Time in milliseconds to wait between searches.
	 */
	public static long PAUSE=400;
	
	/**
	 * Time in milliseconds to wait in a search if the pheromone mode is active.
	 */
	public static int EXPLORATION_PAUSE=1000;
	
	/**
	 * Maximum time to wait for replies when checking for the same manager.
	 */
	public static final long REPTO_MANAGER=4000;
	
	/**
	 * Time to wait after a communication with other agents - Carry Objects
	 */
	public static int COMMUNICATION_LATENCE_CARRY=400;
	
	/**
	 * Time to wait after a communication with other agents - Space Exploration
	 */
	public static int COMMUNICATION_LATENCE_EXPL=800; 
	
	/**
	 * Time to wait after a communication with other agents - Carry Objects Coordinator
	 */
	public static int COMMUNICATION_LATENCE_CARRY_COOR=400;
	
	/**
	 * If true multiple agents can occupy the nest at the same time.
	 */
	public static boolean MULTIPLE_AGENTS_NEST=true;
	
	
	
	/*-------------------Timers-------------------*/
	
	/**
	 * If no object is picked up and carried for n milliseconds then exit
	 */
	public static final int END_TIMER_DELAY = 25000; 
	
	/**
	 * Save the statistical data every DATA_SAVE_INTERVAL ms
	 */
	public static final int DATA_SAVE_INTERVAL = 100;  
	
	
	
	/*-------------------Object Transport-------------------*/
	
	/**
	 * if true, the number of objects carried is incremented also for the slave 
	 */
	public static boolean COLLABORATIVE_TRANSPORT_INC_OBJ=true;
	
	/**
	 * The type of contact that the agent utilize when it became Manager and need
	 * to contact other agents (Carriers).
	 * 
	 * 1: Random
	 * 2: All (only the first n-th answers are considered)
	 * 3: Wait Mode
	 */
	public static int contactType=1;
	
	/**
	 * Activity Code. Activity: interruptible movement.
	 */
	public static final int MODE_MOVEMENT_INT=1;
	
	/**
	 * Activity Code.  Activity: non interruptible movement
	 */
	public static final int MODE_MOVEMENT_NO_INT=2;
	
	/**
	 * Activity Code. Activity not defined.
	 */
	public static final int MODE_NULL=0;
	
	
	
	/*-------------------Exploration-------------------*/
	
	/**
	 * If true the pheromone mode is active.
	 */
	public static final boolean PHEROMONE_MODE=true;
	
	/**
	 * The type of contact that the agent utilize when it became Manager and need
	 * to contact other agents (Carriers).
	 * 
	 * 1: Random
	 * 2: Master-Slave
	 */
	public static int searchType=2;
	
	/**
	 * Every SIMULATION_TIME ms we check for the end of the simulation
	 */
	public static final int SIMULATION_TIME=1000;
	
	
	
	/*-------------------Mode Change-------------------*/
	
	/**
	 * If true the agents check if they need to change the exploration mode based on the number of known squares.
	 */
	public static final boolean KNOWN_THRESHOLD=true;
	
	/**
	 * If true the agents check if they need to change the exploration mode based on the elapsed time vs the known squares. random ->master/slave
	 */
	public static final boolean TIME_THRESHOLD=false;
	
	/**
	 * If true the agents check if they need to change the exploration mode based on the number of obstacles. master/slave -> random 
	 */
	public static final boolean OBSTACLES_THRESHOLD_INV=true;
	
	/**
	 * If true the agents check if they need to change the exploration mode based on the elapsed time vs the known squares. master/slave -> random
	 */
	public static final boolean TIME_THRESHOLD_INV=false;
	
	/**
	 * The threshold for the mode change based on the based on the number of obstacles. random ->master/slave.
	 */
	public static final float OBSTACLES_THRESHOLD_LIMIT=(float) 1.1;
	
	/**
	 * The threshold for the mode change based on the elapsed time vs the known squares. random ->master/slave.
	 */
	public static final float TIME_THRESHOLD_LIMIT= 5;
	
	/**
	 * The threshold for the mode change based on the squares already visited by other agents vs the explored squares.
	 */
	public static final float KNOWN_THRESHOLD_LIMIT= 20/30;
	
	/**
	 * The threshold for the mode change based on the based on the number of obstacles. master/slave -> random 
	 */
	public static final float OBSTACLES_THRESHOLD_LIMIT_INV=(float) 0.4;
	
	/**
	 * The threshold for the mode change based on the elapsed time vs the known squares. master/slave -> random 
	 */
	public static final float TIME_THRESHOLD_LIMIT_INV= 2;
	
	
	
	/*-------------------Counter Names-------------------*/
	
	/**
	 * The number of agents active in the environment.
	 */
	public static final String ID_COUNTER= "IDC";
	
	/**
	 * The number of agents who acknowledged the reset variable.
	 */
	public static final String RESET_COUNTER= "RC";
	
	/**
	 * The number of agents who acknowledged the exit variable.
	 */
	public static final String EXIT_COUNTER= "EC";
	
	/**
	 * The number of agents who finalized their state in the simulation.
	 */
	public static final String TIMER_END_COUNTER= "TEC";
	
	/**
	 * The number of agents who initialized their data.
	 */
	public static final String START_COUNTER= "SC";
	
	/**
	 * The number of agents who initialized their data.
	 */
	public static final String CHANGE_MODE_COUNTER= "CMC";
	
	/**
	 * The number of agents who became managers.
	 */
	public static final String MANAGER_COUNTER= "MC";
	
	public static final String[] counterNames={ID_COUNTER,RESET_COUNTER,EXIT_COUNTER,TIMER_END_COUNTER,START_COUNTER,MANAGER_COUNTER,CHANGE_MODE_COUNTER};

	
	
	/*-------------------Boolean Names-------------------*/
	
	/**
	 * If true the agent will stop moving when it returns to the nest.
	 */
	public static final String STOP_BOOL= "SB";
	
	/**
	 * If true the agent will reset its state and the Environment.
	 */
	public static final String RESET_BOOL= "RB";
	
	/**
	 * If true the agent will terminate itself.
	 */
	public static final String EXIT_BOOL= "EB";
	
	/**
	 * Variable to reset the agent only on time if no further changes are made.
	 */
	public static final String TIMER_END_BOOL= "TEB";
	
	/**
	 * Variable to reset the agent only one time if no further changes are made.
	 */
	public static final String ONLY_ONE_RESET_BOOL= "SC";
	
	/**
	 * Variable to end the simulation if a condition is met.
	 */
	public static final String END_SEARCH_MOVEMENT_BOOL= "ESMB";	
	
	/**
	 * If true the mode change already happened. random ->master/slave
	 */
	public static final String MASTER_BLOCK_BOOL= "MBB";
	
	/**
	 * If true the mode change already happened. master/slave -> random
	 */
	public static final String MASTER_BLOCK_INV_BOOL= "MBIB";
	
	/**
	 * If the element corresponding with the agent id is true the agent will terminate itself.
	 */
	public static final String EXIT_AGENT_BASE_BOOL= "EABB";
	
	/**
	 * If all the booleans contained are true, then the simulation will end
	 */
	public static final String END_CHECK_BASE_BOOL= "ECBB";
	
	public static final String[] boolNames={STOP_BOOL,RESET_BOOL,EXIT_BOOL,TIMER_END_BOOL,ONLY_ONE_RESET_BOOL,END_SEARCH_MOVEMENT_BOOL,MASTER_BLOCK_BOOL,MASTER_BLOCK_INV_BOOL};
	
	public static final boolean[] boolInitValues={true,false,false,false,false,false,false,false};
}
